package com.project.managementpaltform.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface OrdinaryUsersMapper {

    /**
     * 查询当前用户的权限
     * @param OrdinaryUsers 参与人员
     * */
    @Select("SELECT State leader FROM ordinary users WHERE Ordinary users = #{OrdinaryUsers} AND ROWNUM=1")
    String queryStateByOrdinaryUsers(@Param("Ordinary users") String OrdinaryUsers);


    /**
     * 插入新的项目参与关系
     *
     * */
    @Insert("INERT INTO ordinary users (Ordinary users,Password,State)" +
            " VALUES(#{OrdinaryUsers},#{Password},#{State})")
    int insertOrdinaryUsers(@Param("Ordinary users") String OrdinaryUsers,
                      @Param("Password") String Password,
                      @Param("State") String State);
}
